home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8042 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  881 b 

  1. Path: colossus.holonet.net!russell
  2. From: russell@news.mdli.com (Russell Blackadar)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: type-casting in multi-inheritance
  5. Date: 13 Feb 1996 02:04:06 GMT
  6. Organization: HoloNet National Internet Access System: 510-704-1058/modem
  7. Message-ID: <4forim$iv8@colossus.holonet.net>
  8. References: <DMn7Ix.G9@Virginia.EDU>
  9. NNTP-Posting-Host: jubal.mdli.com
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. Gregory Carl Lewin (gcl8a@Virginia.EDU) wrote:
  13. : I am a bit fuzzy about casting from pointers to derived objects
  14. : to base classes...
  15.  
  16. : class Base1 {};
  17. : class Base2 {};
  18. : class Derived12 : public Base1, Base2 {};
  19.                                   ^^^^^
  20.                   should be      public Base2
  21. ...
  22.  
  23. : Because Derived 12 is publicly derived from Base1 and Base2...
  24.  
  25. Alas, no -- you derived it publicly only from Base1.
  26. --
  27. Russell Blackadar,   russell@mdli.com
  28.